import request from '@/utils/request'

export function settingAPI(params) {
  return request({
    url: '/sys/role',
    method: 'GET',
    params
  })
}

// 新增
export function addsettingAPI(data) {
  return request({
    url: '/sys/role',
    method: 'POST',
    data
  })
}
// 删除
export function delsettingAPI(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'DELETE'
  })
}
// 获取详情
export function getsettingAPI(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'GET'
  })
}

// 修改
export function updatesettingAPI(data) {
  return request({
    url: `/sys/role/${data.id}`,
    method: 'PUT',
    data: data
  })
}

// 权限
export function permissionsettingAPI() {
  return request({
    url: '/sys/permission',
    method: 'GET'
  })
}

// 分配权限
export function permissionstingAPI(data) {
  return request({
    url: '/sys/role/assignPrem',
    method: 'put',
    data
  })
}

